package org.gov.vis.main;

import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

import org.gov.vis.components.VISTextField;
import org.gov.vis.gui.VisBaseDialog;
import org.gov.vis.gui.util.GuiUtil;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class VISLoginDialog extends VisBaseDialog {

	/**
	 * 
	 */
	private static final long serialVersionUID = 3970444841221165890L;
	private JPanel loginPanel;
	private JButton btnLogin;
	private JPanel errorPanel;
	private JPanel visDialogPnl;
	private JLabel lblLgnName;
	private JButton btnReset;
	private JPanel loginPnl;
	private VISTextField txtPassword;
	private JLabel lblPassword;
	private VISTextField txtUsrName;
	private JLabel lblUsrName;

	/**
	 * @param owner
	 * @param title
	 * @param modal
	 */
	public VISLoginDialog(Frame owner, String title, boolean modal) {
		super(owner, title, modal);
		initGUI();
		GuiUtil.CompCenterCords cords=GuiUtil.getCompCenterCords(500, 300);
		setBounds(cords.getX(), cords.getY(), 400, 400);
	}

	private void initGUI() {
		GridBagLayout thisLayout = new GridBagLayout();
		thisLayout.rowWeights = new double[] {0.1};
		thisLayout.rowHeights = new int[] {7};
		thisLayout.columnWeights = new double[] {0.1};
		thisLayout.columnWidths = new int[] {7};
		this.setSize(400, 400);
		getContentPane().setLayout(thisLayout);
		{
			loginPanel = new JPanel();
			GridBagLayout loginPanelLayout = new GridBagLayout();
			loginPanelLayout.columnWidths = new int[] {7, 7, 7, 7, 7};
			loginPanelLayout.rowHeights = new int[] {7, 20, 7, 7, 7, 48, 7, 48, 7, 61, 7, 7};
			loginPanelLayout.columnWeights = new double[] {0.0, 0.0, 0.0, 0.0, 0.0};
			loginPanelLayout.rowWeights = new double[] {0.0, 0.1, 0.0, 0.1, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.1};
			getContentPane().add(loginPanel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
			loginPanel.setLayout(loginPanelLayout);
			{
				lblUsrName = new JLabel();
				loginPanel.add(lblUsrName, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblUsrName.setText("User Name :");
			}
			{
				txtUsrName = new VISTextField();
				loginPanel.add(txtUsrName, new GridBagConstraints(3, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				lblPassword = new JLabel();
				loginPanel.add(lblPassword, new GridBagConstraints(1, 7, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				lblPassword.setText("Password :");
			}
			{
				txtPassword = new VISTextField();
				loginPanel.add(txtPassword, new GridBagConstraints(3, 7, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
			}
			{
				loginPnl = new JPanel();
				loginPanel.add(loginPnl, new GridBagConstraints(3, 9, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
				{
					errorPanel = new JPanel();
					loginPanel.add(errorPanel, new GridBagConstraints(0, 1, 4, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
					{
						visDialogPnl = new JPanel();
						loginPanel.add(visDialogPnl, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
						{
							lblLgnName = new JLabel();
							visDialogPnl.add(lblLgnName);
							lblLgnName.setText("VIS LOGIN");
							lblLgnName.setPreferredSize(new java.awt.Dimension(128, 16));
						}
					}
				}
				{
					btnLogin = new JButton();
					loginPnl.add(btnLogin);
					btnLogin.setText("Login");
					btnLogin.setPreferredSize(new java.awt.Dimension(76, 30));
					btnLogin.addActionListener(new LoginListener(this));
				}
				{
					btnReset = new JButton();
					loginPnl.add(btnReset);
					btnReset.setText("Reset");
					btnReset.setPreferredSize(new java.awt.Dimension(78, 30));
					btnReset.addActionListener(new LoginListener(this));
				}
			}
		}
	}

	/**
	 * @return the loginPanel
	 */
	public JPanel getLoginPanel() {
		return loginPanel;
	}

	/**
	 * @param loginPanel the loginPanel to set
	 */
	public void setLoginPanel(JPanel loginPanel) {
		this.loginPanel = loginPanel;
	}

	/**
	 * @return the btnLogin
	 */
	public JButton getBtnLogin() {
		return btnLogin;
	}

	/**
	 * @param btnLogin the btnLogin to set
	 */
	public void setBtnLogin(JButton btnLogin) {
		this.btnLogin = btnLogin;
	}

	/**
	 * @return the btnReset
	 */
	public JButton getBtnReset() {
		return btnReset;
	}

	/**
	 * @param btnReset the btnReset to set
	 */
	public void setBtnReset(JButton btnReset) {
		this.btnReset = btnReset;
	}

	/**
	 * @return the loginPnl
	 */
	public JPanel getLoginPnl() {
		return loginPnl;
	}

	/**
	 * @param loginPnl the loginPnl to set
	 */
	public void setLoginPnl(JPanel loginPnl) {
		this.loginPnl = loginPnl;
	}

	/**
	 * @return the txtPassword
	 */
	public VISTextField getTxtPassword() {
		return txtPassword;
	}

	/**
	 * @param txtPassword the txtPassword to set
	 */
	public void setTxtPassword(VISTextField txtPassword) {
		this.txtPassword = txtPassword;
	}

	/**
	 * @return the lblPassword
	 */
	public JLabel getLblPassword() {
		return lblPassword;
	}

	/**
	 * @param lblPassword the lblPassword to set
	 */
	public void setLblPassword(JLabel lblPassword) {
		this.lblPassword = lblPassword;
	}

	/**
	 * @return the txtUsrName
	 */
	public VISTextField getTxtUsrName() {
		return txtUsrName;
	}

	/**
	 * @param txtUsrName the txtUsrName to set
	 */
	public void setTxtUsrName(VISTextField txtUsrName) {
		this.txtUsrName = txtUsrName;
	}

	/**
	 * @return the lblUsrName
	 */
	public JLabel getLblUsrName() {
		return lblUsrName;
	}

	/**
	 * @param lblUsrName the lblUsrName to set
	 */
	public void setLblUsrName(JLabel lblUsrName) {
		this.lblUsrName = lblUsrName;
	}

	/**
	 * @return the errorPanel
	 */
	public JPanel getErrorPanel() {
		return errorPanel;
	}

	/**
	 * @param errorPanel the errorPanel to set
	 */
	public void setErrorPanel(JPanel errorPanel) {
		this.errorPanel = errorPanel;
	}

}
